package com.service.impl;

import com.bean.Room;
import com.dao.impl.RoomDAOImpl;
import com.service.RoomService;

import java.sql.SQLException;
import java.util.List;
import java.util.Map;

public class RoomServiceImpl implements RoomService {

    RoomDAOImpl roomDAO = new RoomDAOImpl();
    @Override
    public List<Room> selectAll() throws SQLException {
        return roomDAO.selectAll();
    }
    @Override
    public boolean deleteById(Integer id) throws SQLException {
        return roomDAO.deleteById(id);
    }
    @Override
    public boolean removeAll(String[] idsArr) throws SQLException {
        return roomDAO.deleteAll(idsArr);
    }
    @Override
    public boolean insert(Room r) throws SQLException {
        return roomDAO.insert(r);
    }
    @Override
    public boolean update(Room r) throws SQLException {
        return roomDAO.update(r);
    }

    @Override
    public Integer count() throws SQLException {
        return roomDAO.count();
    }

    @Override
    public Integer countSearch(String search) throws SQLException {
        return roomDAO.countSearch(search);
    }

    @Override
    public Integer countSearch(Map<String,String> map) throws SQLException {
        return roomDAO.countSearch(map);
    }


    @Override
    public List<Room> selectAllPagination(Integer offset, Integer limit) throws SQLException {
        return roomDAO.selectAllPagination(offset,limit);
    }

    @Override
    public List<Room> selectAllPaginationSearch(Integer offset, Integer limit, String search) throws SQLException {
        return roomDAO.selectAllPaginationSearch(offset,limit,search);
    }

    @Override
    public List<Room> selectAllPaginationSearch(Integer offset, Integer limit, Map map) throws SQLException {
        return roomDAO.selectAllPaginationSearch(offset,limit,map);
    }
}
